# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: execute.py
# Time: 19:21

from common.element.elements import PocoElement
from common.util.api_util import get_yaml_data
from pages.transition.handler import TransitionHandler


class TransitionBiz():
    def __init__(self, poco, log):
        self.__log = log
        self.__poco = PocoElement(poco, log)
        self.handler = TransitionHandler(poco, log)
        self.page = get_yaml_data("transition.yaml")

    def transition(self):
        self.__poco.the_direction_of_the_sliding("left", 3)
        self.__poco.click_on_the_element(self.handler.get_lijitiyan())
        self.__poco.click_on_the_element(self.handler.get_querenyinsi())
        self.__poco.click_on_the_element(self.handler.get_guanbitanchaung())
        self.__poco.poco_smart_click(self.page.get("tongyiquanxian"))
        self.__poco.poco_smart_click(self.page.get("tongyiquanxian"))
        self.__poco.poco_smart_click(self.handler.get_gengxintanchaung())

